package org.huzhp.gateway.dynamic.rule;

import org.huzhp.gateway.dynamic.ConsoleProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Description: 规则配置类
 * @Author: huzp
 * @CreateDate: 2020/3/20 11:23
 * @Version: 1.0
 */

@Configuration
public class ConsoleRuleConfig {

    @Bean
    public ConsoleConverter consoleConverter() {
        return new ConsoleConverter();
    }

    @Bean
    public ConsoleRuleDataSource consoleRuleDataSource(ConsoleProperties consoleProperties, RestTemplate restTemplate) {
        return new ConsoleRuleDataSource(consoleProperties, restTemplate, consoleConverter());
    }


}
